package com.yz.dadatasource.dynamic.config.zookeeper;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

import javax.sql.DataSource;

public class DynamicDataSource extends AbstractRoutingDataSource {

    private   DataSource dataSource =null;
    @Override
    protected Object determineCurrentLookupKey() {
        return null;
    }

    @Override
    protected DataSource determineTargetDataSource() {
        return getDataSource();
    }



    public  void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    public  DataSource getDataSource() {
        return dataSource;
    }
}
